﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DeviceManager.DB.Model
{
    /// <summary>
    /// 设备信息
    /// </summary>
    class DeviceNode
    {
        /// <summary>
        /// 设备ID
        /// </summary>
        public int Id { get; set; }
        /// <summary>
        /// 设备代码
        /// </summary>
        public string DeviceCode { get; set; }
        /// <summary>
        /// 设备类型
        /// </summary>
        public int DeviceType { get; set; }
        /// <summary>
        /// 设备类型名称
        /// </summary>
        public string DeviceTypeName { get; set; }
        /// <summary>
        /// 设备所属部门
        /// </summary>
        public int DeviceDepID { get; set; }
        /// <summary>
        ///  设备所属部门名称
        /// </summary>
        public string DeviceDepName { get; set; }
        /// <summary>
        /// 设备名称
        /// </summary>
        public string DeviceName { get; set; }
        /// <summary>
        /// 设备描述
        /// </summary>
        public string DeviceDes { get; set; }
        /// <summary>
        /// 设备安装位置
        /// </summary>
        public string DeviceInstall { get; set; }
        /// <summary>
        /// 设备支持最大电压
        /// </summary>
        public float DeviceMaxVoltage { get; set; }
        /// <summary>
        /// 设备最低电压
        /// </summary>
        public float DeviceMinVoltage { get; set; }
        /// <summary>
        /// 设备当前电压
        /// </summary>
        public float DeviceVoltage { get; set; }
        /// <summary>
        /// 设备最大电流
        /// </summary>
        public float DeviceMaxElectricCurrent { get; set; }
        /// <summary>
        /// 设备最小电流
        /// </summary>
        public float DeviceMinElectricCurrent { get; set; }
        /// <summary>
        /// 设备当前电流
        /// </summary>
        public float DeviceElectricCurrent { get; set; }
        /// <summary>
        /// 设备最大工作温度
        /// </summary>
        public float DeviceMaxTemperature { get; set; }
        /// <summary>
        /// 设备最小工作温度
        /// </summary>
        public float DeviceMinTemperature { get; set; }
        /// <summary>
        /// 设备工作温度
        /// </summary>
        public float DeviceTemperature { get; set; }
        /// <summary>
        /// 设备最大工作湿度
        /// </summary>
        public float DeviceMaxHumidity { get; set; }
        /// <summary>
        /// 设备最小工作湿度
        /// </summary>
        public float DeviceMinHumidity { get; set; }
        /// <summary>
        /// 设备当前湿度
        /// </summary>
        public float DeviceHumidity { get; set; }
        /// <summary>
        /// 设备是否正在维护中
        /// </summary>
        public int DeviceIsMaintain { get; set; }
        /// <summary>
        /// 设备上一次更新数据时间
       /// </summary>
        public DateTime DeviceLastUpDate { get; set; }
        /// <summary>
        /// 设备更新数据最大间隔时间，根据这个判断设备是否已掉线
        /// </summary>
        public float DeviceUpDateTime { get; set; }
        /// <summary>
        /// 设备是否在线
        /// </summary>
        public bool DeviceIsOnLine { get; set; }

        public DateTime installDate;


        /// <summary>
        /// 设备安装日期
        /// </summary>
        public string DeviceInstallDate { get { return installDate.ToString("yyyy年MM月dd日"); } set { DateTime.TryParse(value, out installDate); } }

    }
}
